<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		#tiao{
			position: absolute;
			top: 30px;
		}
	</style>
</head>
<body style="height:3000px;">
	
          <div id="tiao">
          	12312
          </div>

	<script type="text/javascript">
		var absolute = document.getElementById('tiao').offsetTop
        window.onscroll = function(event) {
        	var a = document.body.scrollTop
        	/* Act on the event */
        	//alert(1)
        	console.log(absolute,a)
        };

	</script>
</body>
</html>